package com.kusiri.kframework.salesforce.action
{
	
	import com.kusiri.kframework.IKfApplication;
	import com.kusiri.kframework.KfApplicationLocator;
	import com.kusiri.kframework.salesforce.model.ISObject;
	import com.kusiri.kframework.salesforce.ui.component.sobject.KfSObjectView;
	 
	public class OpenSObjectViewAction implements IOpenSObjectViewAction
	{
		private var kfApplication : IKfApplication = new KfApplicationLocator().kfApplication;
		private var _valueObject : ISObject;
		
		public function get valueObject() : ISObject
		{
			return _valueObject;
		}
		
		public function set valueObject(sobject : ISObject) : void
		{
			_valueObject = sobject;
		}
		
		public function OpenSObjectViewAction() : void
		{
			//
		}
		
		/**
		 * Execute the action
		 */
		public function execute() : void
		{
			var view : KfSObjectView = new KfSObjectView();
			view.valueObject = valueObject;
			kfApplication.uiContainer.addUiComponent(view);
		}


	}
}